<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<%
	String path = request.getContextPath();
	// 获得本项目的地址(例如: http://localhost:8080/MyApp/)赋值给basePath变量 
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	// 将 "项目路径basePath" 放入pageContext中，待以后用EL表达式读出。 
	pageContext.setAttribute("basePath", basePath);
	//out.write(basePath);
%>

<link href="<%=basePath%>bootstrap/css/bootstrap.min.css"
	rel="stylesheet">
<link href="<%=basePath%>bootstrap/css/style.css" rel="stylesheet">


<style>
.h {
	font-style: normal;
	color: blue;
}
</style>


</head>
<body>

	<form action="<%=basePath%>UserSelectCou" method="post">
		<div>
			<div class="bs-example">
				<table class="table table-striped table-hover">
					<thead>
						<tr>
							<th>#</th>
							<th>课程号</th>
							<th>课程名称</th>
							<th>课程类别</th>
							<th>课程性质</th>
							<th>授课教师</th>
							<th>学分</th>
							<th>状态</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>

						<input type="hidden" id="listLong" name="listLong"
							value="${sessionScope.listLong }">
						<input type="hidden" id="listLongNo" name="listLongNo"
							value="${sessionScope.listLongNo }">
						<input type="hidden" id="userNum" name="userNum"
							value="${loginedUsersBA.usernum }">


						<c:forEach items="${sessionScope.stuCou }" var="eachUser"
							varStatus="st">

							<!-- lstUsersTea.addAll(lstUsersTea1); -->

							<input type="hidden" id="selectCouid"
								name="selectCouid${st.index+1 }" value="${eachUser.couid }">
							<tr>
								<td>${st.index+1 }</td>
								<td>${eachUser.couid }</td>
								<td>${eachUser.couname }</td>
								<td>${eachUser.coucategory }</td>
								<td>${eachUser.counatyre }</td>
								<td>${eachUser.teaname }</td>
								<td>${eachUser.coucredit }</td>
								<td class="h">已选</td>
								<td><a
									href="UserSelectStuCou?usernum=${loginedUsersBA.usernum }&selectCouid=${eachUser.couid }&opt=0"
									onclick="return confirm('您确认退出此课程吗?');">退选</a></td>

								<td><input type="checkbox" id="chHobby${st.index+1 }"
									name="chHobby${st.index+1 }" checked="checked" /></td>
							</tr>
						</c:forEach>
					</tbody>

					<tbody>
						<c:forEach items="${sessionScope.stuCouNo }" var="eachUsera"
							varStatus="sta">
							<input type="hidden" id="selectCouidNo"
								name="selectCouidNo${sta.index+1 }" value="${eachUsera.couid }">

							<tr>
								<td>${sessionScope.listLong+sta.index+1}</td>
								<td>${eachUsera.couid }</td>
								<td>${eachUsera.couname }</td>
								<td>${eachUsera.coucategory }</td>
								<td>${eachUsera.counatyre }</td>
								<td>${eachUsera.teaname }</td>
								<td>${eachUsera.coucredit }</td>
								<td>未选</td>
								<td><a
									href="UserSelectStuCou?usernum=${loginedUsersBA.usernum }&selectCouid=${eachUsera.couid }&opt=1">选课</a></td>
								<td><input type="checkbox" id="chHobbya${sta.index+1 }"
									name="chHobbya${sta.index+1 }" /></td>

							</tr>
						</c:forEach>
					</tbody>
				</table>
				<div class="col-sm-offset-2 col-sm-2">
					<!-- 超链接
										<a class="btn btn-default"
						href="logined/UserInfoManager/userTeaQuery.jsp">返回</a>
						 -->


					<button type="submit" class="btn btn-default">提交</button>

					<button type="reset" class="btn btn-default">重置</button>

				</div>
			</div>
		</div>
	</form>
	<script src="<%=basePath%>bootstrap/js/jquery.min.js"></script>
	<script src="<%=basePath%>bootstrap/js/bootstrap.min.js"></script>
	<script src="<%=basePath%>bootstrap/js/scripts.js"></script>
</body>


</html>